#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <audiothread.h>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow) {
    ui->setupUi(this);
}

MainWindow::~MainWindow() {
    delete ui;
}

void MainWindow::on_audioButton_clicked() {
    _audioThread = new AudioThread(this); // 当this析构,这个线程也会析构
    _audioThread->start(); // 会调用线程内部的run()方法
}

